//
//  BaseTextField.m
//  mobile
//
//  Created by abc on 2018/1/31.
//  Copyright © 2018年 azazie. All rights reserved.
//

#import "BaseTextField.h"

NSUInteger const ViewCornerNone = 0;
NSUInteger const ViewCornerTop = 1;
NSUInteger const ViewCornerBottom = 2;
NSUInteger const ViewCornerAll = 3;

@implementation BaseTextField

- (CGRect)caretRectForPosition:(UITextPosition *)position {
    if (_hidesCaret)
    {
        return CGRectZero;
    }
    return [super caretRectForPosition:position];
}

- (BOOL)canPerformAction:(SEL)action withSender:(id)sender {
    if (_disablesActionMenu) {
        if (action == @selector(paste:)) {
            return NO;
        }
        if (action == @selector(select:)) {
            return NO;
        }
        if (action == @selector(selectAll:)) {
            return NO;
        }
    }
    return [super canPerformAction:action withSender:sender];
}

@end
